package com.ruoyi.info.service.impl;

import com.ruoyi.info.domain.FhInfoCatchrecord;
import com.ruoyi.info.mapper.FhInfoCatchrecordMapper;
import com.ruoyi.info.service.IFhInfoCatchrecordService;
import com.ruoyi.map.domain.FhInfoCatchrecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 渔获记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-22
 */
@Service
public class FhInfoCatchrecordServiceImpl implements IFhInfoCatchrecordService 
{
    @Autowired
    private FhInfoCatchrecordMapper fhInfoCatchrecordMapper;

    /**
     * 查询渔获记录
     * 
     * @param id 渔获记录主键
     * @return 渔获记录
     */
    @Override
    public FhInfoCatchrecord selectFhInfoCatchrecordById(Long id)
    {
        return fhInfoCatchrecordMapper.selectFhInfoCatchrecordById(id);
    }

    /**
     * 查询渔获记录列表
     * 
     * @param fhInfoCatchrecord 渔获记录
     * @return 渔获记录
     */
    @Override
    public List<FhInfoCatchrecord> selectFhInfoCatchrecordList(FhInfoCatchrecord fhInfoCatchrecord)
    {
        return fhInfoCatchrecordMapper.selectFhInfoCatchrecordList(fhInfoCatchrecord);
    }

    /**
     * 新增渔获记录
     * 
     * @param fhInfoCatchrecord 渔获记录
     * @return 结果
     */
    @Override
    public int insertFhInfoCatchrecord(FhInfoCatchrecord fhInfoCatchrecord)
    {
        return fhInfoCatchrecordMapper.insertFhInfoCatchrecord(fhInfoCatchrecord);
    }

    /**
     * 修改渔获记录
     * 
     * @param fhInfoCatchrecord 渔获记录
     * @return 结果
     */
    @Override
    public int updateFhInfoCatchrecord(FhInfoCatchrecord fhInfoCatchrecord)
    {
        fhInfoCatchrecord.setUpdateTime(LocalDateTime.now());
        return fhInfoCatchrecordMapper.updateFhInfoCatchrecord(fhInfoCatchrecord);
    }

    /**
     * 批量删除渔获记录
     * 
     * @param ids 需要删除的渔获记录主键
     * @return 结果
     */
    @Override
    public int deleteFhInfoCatchrecordByIds(Long[] ids)
    {
        return fhInfoCatchrecordMapper.deleteFhInfoCatchrecordByIds(ids);
    }

    /**
     * 删除渔获记录信息
     * 
     * @param id 渔获记录主键
     * @return 结果
     */
    @Override
    public int deleteFhInfoCatchrecordById(Long id)
    {
        return fhInfoCatchrecordMapper.deleteFhInfoCatchrecordById(id);
    }

    @Override
    public FhInfoCatchrecord selectFhInfoCatchrecordByUserId(Long userId) {
        return fhInfoCatchrecordMapper.selectFhInfoCatchrecordByUserId(userId);
    }

    @Override
    public FhInfoCatchrecordVO getFishForecasting() {
        return fhInfoCatchrecordMapper.getFishForecasting();
    }
}
